package cn.tonyandmoney.warescanapp.socket

/**
 * Created by niantuo on 2018/2/28.
 * websocket 事件类
 */
data class RxSocketEvent(var url: String,
                         var code: Int = 0,
                         var msg: String = "",
                         var data: Any? = null,
                         var errCode: Int = 0,
                         var error: Throwable? = null) {

    companion object {
        const val CODE_CONNECT = 0      //连接成功
        const val CODE_MSG_STRING = 1  //收到字符串信息
        const val CODE_MSG_BYTE = 2     //时候数据流
        const val CODE_DISCONNECT = -10  //失去；连接
        const val CODE_ERROR_UNKNOWN = -1  //未知错误
        const val CODE_CONNECT_ERROR = -2  //连接错误

        const val CODE_SEND_SUCCESS = 3  //发送消息成功
        const val CODE_SEND_FAILED = 4   //发送消息失败
    }
}